/*
 * HttpStringBody.cpp
 *
 */

#include "HttpStringBody.h"
#include "HttpHeader.h"

HttpStringBody::HttpStringBody(const std::string& body): body(body) {
	size = body.length();
}

HttpStringBody::~HttpStringBody() {}

HttpHeader* HttpStringBody::getContentLength() const {
	std::stringstream buffer;
	buffer << size;
	return new HttpHeader(HttpHeader::CONTENT_LENGTH, buffer.str());
}

size_t HttpStringBody::getSize() const {
	return size;
}

std::istream& HttpStringBody::getStream() {
	return body;
}
